package cn.gson.springmvc.model.pojos;

import javax.persistence.*;
import java.util.Collection;
import java.util.Objects;

@Entity
public class Division {
    private int divisionId;
    private String divisionName;
    private String divisionAddress;
    private Integer divisionIsshow;

    @Id
    @Column(name = "division_id", nullable = false)
    public int getDivisionId() {
        return divisionId;
    }

    public void setDivisionId(int divisionId) {
        this.divisionId = divisionId;
    }

    @Basic
    @Column(name = "division_name", nullable = true, length = 30)
    public String getDivisionName() {
        return divisionName;
    }

    public void setDivisionName(String divisionName) {
        this.divisionName = divisionName;
    }

    @Basic
    @Column(name = "division_address", nullable = true, length = 30)
    public String getDivisionAddress() {
        return divisionAddress;
    }

    public void setDivisionAddress(String divisionAddress) {
        this.divisionAddress = divisionAddress;
    }

    @Basic
    @Column(name = "division_isshow", nullable = true)
    public Integer getDivisionIsshow() {
        return divisionIsshow;
    }

    public void setDivisionIsshow(Integer divisionIsshow) {
        this.divisionIsshow = divisionIsshow;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Division division = (Division) o;
        return divisionId == division.divisionId &&
                Objects.equals(divisionName, division.divisionName) &&
                Objects.equals(divisionAddress, division.divisionAddress) &&
                Objects.equals(divisionIsshow, division.divisionIsshow);
    }

    @Override
    public int hashCode() {
        return Objects.hash(divisionId, divisionName, divisionAddress, divisionIsshow);
    }


}
